<template>
  <div>
    <a-input-search
        :value="value"
        placeholder="请选择"
        readOnly
        :disabled="disabled"
        @search="onSelectActivity">
    </a-input-search>
    <ZSelectEcardCompanyModal ref="selectModal" :modal-width="modalWidth" v-bind="$attrs" @ok="selectOK" />
  </div>
</template>

<script>
import ZSelectEcardCompanyModal from './modules/ZSelectEcardCompanyModal'
export default {
  name: 'ZSelectActivity',
  components: { ZSelectEcardCompanyModal },
  props: {
    modalWidth: {
      type: Number,
      default: 1200,
      required: false
    },
    value: {
      type: String,
      required: false
    },
    disabled: {
      type: Boolean,
      required: false,
      default: false
    }
  },
  data() {
    return {

    }
  },
  model: {
    prop: 'value',
    event: 'change'
  },
  methods: {
    onSelectActivity(){
      this.$refs.selectModal.showModal()
    },
    selectOK(codes, row) {
      this.$emit('change', codes, row)
    }
  }
}
</script>
